<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background: url('https://images.unsplash.com/photo-1510915361894-db8b60106cb1') no-repeat center center fixed;
            background-size: cover;
        }

        .login-container {
            width: 400px;
            padding: 40px;
            border-radius: 15px;
            background-color: rgba(255, 255, 255, 0.85);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.3);
        }

        .form-title {
            text-align: center;
            font-size: 24px;
            color: #333;
            margin-bottom: 30px;
        }

        .form-group {
            margin-bottom: 25px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #555;
            font-size: 14px;
        }

        .form-group input {
            width: 100%;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 14px;
            transition: border-color 0.3s;
            box-sizing: border-box;
            background-color: rgba(255, 255, 255, 0.7);
        }

        .form-group input:focus {
            border-color: #4A90E2;
            outline: none;
        }

        .auto-login {
            margin: 15px 0;
            color: #666;
            font-size: 14px;
        }

        .btn-group {
            display: flex;
            gap: 15px;
            margin-top: 30px;
        }

        .btn {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 6px;
            font-size: 15px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-login {
            background-color: #4A90E2;
            color: white;
        }

        .btn-login:hover {
            background-color: #357ABD;
        }

        .btn-register {
            background-color: #F5F5F5;
            color: #666;
            text-decoration: none;
            text-align: center;
        }

        .btn-register:hover {
            background-color: #EBEBEB;
        }

        .error-message {
            color: #ff4d4f;
            margin-bottom: 20px;
            text-align: center;
            font-size: 14px;
        }
    </style>
</head>
<body>
<div class="login-container">
    <h2 class="form-title">欢迎登录</h2>
    <% if(request.getAttribute("error") != null) { %>
    <div class="error-message">${error}</div>
    <% } %>
    <form action="login" method="post">
        <div class="form-group">
            <label>用户名</label>
            <input type="text" name="username" required>
        </div>
        <div class="form-group">
            <label>密码</label>
            <input type="password" name="password" required>
        </div>
        <div class="auto-login">
            <label>
                <input type="checkbox" name="autoLogin">
                7天内自动登录
            </label>
        </div>
        <div class="btn-group">
            <button type="submit" class="btn btn-login">登录</button>
            <a href="register.jsp" class="btn btn-register">注册</a>
        </div>
    </form>
</div>
</body>
</html>
</html>